package com.itheima.collection;

import java.util.ArrayList;

import com.itheima.domain.Student;

/**
 * 直接修改对象的内容
 */
public class Test05_02 {

    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        Student student1 = new Student("黄子韬", 27);
        Student student2 = new Student("鹿晗", 30);
        Student student3 = new Student("吴亦凡", 30);
        Student student4 = new Student("蔡徐坤", 22);
        list.add(student1);
        list.add(student2);
        list.add(student3);
        list.add(student4);


        for (Student student : list) {
            student.setName("张艺兴");
        }

        System.out.println(list);

    }
}
